package com.fanketly.musicdiary.data.db

import androidx.room.TypeConverter
import com.fanketly.musicdiary.utls.GsonUtils
import com.lzx.starrysky.SongInfo

class MusicInfoConverters {
    @TypeConverter
    fun fromJson(json: String): SongInfo {
        return GsonUtils.gson.fromJson(json, SongInfo::class.java)
    }

    @TypeConverter
    fun dataToJson(songInfo: SongInfo): String {
        return GsonUtils.gson.toJson(songInfo)
    }
}